home *** CD-ROM | disk | FTP | other *** search
/ Secrets of Stargate / STARGATE.iso / mac / STARGATE (5MB Macintosh) / STARGATE (5MB Macintosh).DXR / 00046.ls < prev    next >
Encoding:
Text File  |  1994-10-19  |  725 b   |  27 lines

  1. on mouseDown
  2.   global gSlideDelay
  3.   set r to the regPoint of cast "SLIDER2.PIC"
  4.   delete char 1 to 9 of r
  5.   delete char the number of chars in r of r
  6.   set r to value(r)
  7.   set min to 133 + r
  8.   set max to 213 + r
  9.   set range to max - min
  10.   set c to 1
  11.   repeat while the mouseDown
  12.     set newV to the mouseV + r
  13.     if newV > max then
  14.       set newV to max
  15.     else
  16.       if newV < min then
  17.         set newV to min
  18.       end if
  19.     end if
  20.     set thePercent to float(newV - min) / float(range)
  21.     set gSlideDelay to integer((1 - thePercent) * 10.0)
  22.     set newR to integer(float(gSlideDelay) / float(10.0) * float(range)) - range
  23.     set the regPoint of cast "Slider2.PIC" to point(0, newR)
  24.     updateStage()
  25.   end repeat
  26. end
  27.